<p>
<?php

$record = $this->record;

if (isset($this->messages)) {
	foreach ($this->messages as $field => $messages) {
		foreach ($messages as $message) {
			echo $this->escape($message) . "<br />\n";
		}
	}	
}

if (isset($_POST['btnSave'])) {
	foreach($_POST as $key=>$item) {
		$record[$key] = $item;
	}
}
?>
<a href="<?php echo $this->baseUrl; ?>/admin/role">Lists</a> |
<a href="<?php echo $this->baseUrl; ?>/admin/role/add">Add</a> |
<a href="<?php echo $this->baseUrl; ?>/admin/role/delete<?php echo (isset($record['id']) && $record['id'])? "/id/{$record['id']}" : ""; ?>">Delete</a>
<form action="<?php echo $this->baseUrl ?>/admin/role/edit<?php echo (isset($record['id']) && $record['id'])? "/id/{$record['id']}" : ""; ?>" method="POST">
<table cellpadding="2" cellspacing="2">
	<tr>
		<td align="right">Id:</td>
		<td><em><?php echo (isset($record['id']) && $record['id'])? $record['id'] : 'Autogenerated'; ?></em></td>
	</tr>
	<tr>
		<td align="right">*Name:</td>
		<td><input name="name" type="text" value="<?php echo $record['name']; ?>" /></td>
	</tr>
	<tr>
		<td align="right">Super User:</td>
		<td>
			<input name="super_user" type="checkbox" <?php echo ($record['super_user'])? ' checked="checked"' : ''; ?> />
		</td>
	</tr>
	<tr>
		<td align="right">Description:</td>
		<td><input name="description" type="text" value="<?php echo $record['description']; ?>" /></td>
	</tr>
	<tr>
		<td align="right">&nbsp;</td>
		<td>
			<input type="submit" name="btnSave" value="Save">
			<input type="submit" name="btnCancel" value="Cancel">
		</td>
	</tr>
</table>
</form>
</p>
